package vista;
import java.awt.BorderLayout;
import java.util.Vector;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaListadoGrupos extends javax.swing.JFrame {
	private JPanel jPanel1;
	private JScrollPane jScrollPane1;
	private JTable jTableGrupos;
	private JLabel lbllistadogrupos;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaListadoGrupos inst = new VentanaListadoGrupos();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VentanaListadoGrupos() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jPanel1 = new Fondo("imagen.jpg");
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				jPanel1.setLayout(null);
				{
					lbllistadogrupos = new JLabel();
					jPanel1.add(lbllistadogrupos);
					lbllistadogrupos.setText("Listado de Grupos ");
					lbllistadogrupos.setBounds(201, 25, 171, 16);
					lbllistadogrupos.setFont(new java.awt.Font("SansSerif",1,16));
				}
				{
					jScrollPane1 = new JScrollPane();
					jPanel1.add(jScrollPane1);
					jScrollPane1.setBounds(38, 79, 499, 245);
					{
						DefaultTableModel jTableGrupoModel = 
								new DefaultTableModel(
										new String[][] {},
										new String[] { "Codigo", "Nombre", "Nro. de Integrantes", "Responsable" });
						jTableGrupos = new JTable();
						jScrollPane1.setViewportView(jTableGrupos);
						jTableGrupos.setModel(jTableGrupoModel);
						jTableGrupos.setPreferredSize(new java.awt.Dimension(496, 240));
					}
				}
			}
			pack();
			this.setSize(583, 393);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

public void cargarListado(Vector<String> colaborador){
		DefaultTableModel tbl = (DefaultTableModel) this.jTableGrupos.getModel();
		tbl.addRow(colaborador);
	}
}
